package erQiao.yfl.app.service;

import erQiao.yfl.app.dao.entity.Comment;
import erQiao.yfl.app.dao.mapper.CommentMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 评论表
 */
@Service
public class CommentService {
    @Resource
    private CommentMapper commentMapper;

    public int insertComment(Comment comment) {
        return commentMapper.insert(comment);
    }

    /**
     *  Type  int  1 是圈子表  2:话题表;3 偏方表 ....
     *  Cid  int ，圈子表或者话题表,偏方表 id
     * @param userId
     * @return
     */
    public int selectComentCountByCid(int cid,int type){
        return commentMapper.selectComentCountByCid(cid,type);
    }
}
